package com.movie.config;

import com.obs.services.ObsClient;
import com.obs.services.ObsConfiguration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Liu Jiaquan
 * @Description
 * @date 2024/7/21 16:53
 */
@Configuration
public class ObsConfig {

    @Value("${hw.endPoint}")
    private String hwEndPoint;
    @Value("${hw.ak}")
    private String hwAk;
    @Value("${hw.sk}")
    private String hwSk;
    @Value("${hw.bucket-name}")
    private String hwEndBuckName;

    @Bean
    public ObsClient obsClient() {
        ObsConfiguration config = new ObsConfiguration();
        config.setEndPoint(hwEndPoint);
        return new ObsClient(hwAk, hwSk, config);
    }
}

